package krillr.Util;

public class BulletTracker {
    public Point2d bulletSource;
    public Vector2d bulletVector;
    public double bulletHeading, bulletEnergy, bulletSpeed;
    public long creationTime;
    public BulletTracker(Point2d source, double heading, double energy, long ctime) {
        bulletSource = source;
        bulletHeading = heading;
        bulletEnergy = energy;
        bulletVector = new Vector2d();
        bulletVector.setDirection(bulletHeading);
        bulletVector.setMagnitude(20 - 3 * bulletEnergy);
        bulletSpeed = 20 - 3 * bulletEnergy;
        creationTime = ctime;
    }
    
    public Point2d currentLocation(double t) {
        double timeShift = t - creationTime;
        return bulletVector.Multiply(t).translateToPoint(bulletSource);
    }
    
}